package com.infovane.service.impl;



import java.util.List;

import com.infovane.dao.BaseDao;
import com.infovane.model.TUser;
import com.infovane.model.TUserAttention;
import com.infovane.service.UserAttentionService;

public class UserAttentionServiceImpl implements UserAttentionService{
	private BaseDao baseDao;
	
	
	
	
	public BaseDao getBaseDao() {
		return baseDao;
	}




	public void setBaseDao(BaseDao baseDao) {
		this.baseDao = baseDao;
	}




	/**
	 * 根据用户ID获取用户资讯关注类型
	 * @param userId
	 * @return List
	 * */
	public TUserAttention getUserAttention(Long userId) {
		List<TUserAttention> attentionList=null;
		String hql="from TUserAttention as u where u.userId='"+userId+"'";
		attentionList=this.baseDao.load(hql);
		if(attentionList.size()>0){
			return attentionList.get(0);
		}
		return  null;
	}



	/**
	 * 保存用户关注的资讯类型设置
	 * @param Object
	 * @return boolean
	 * */
	public boolean add(Object object) {
		
		return this.baseDao.save(object);
	}

}
